import React from 'react';
import YAML from 'yaml';

import Container from 'components/Container';
import NodesList from './NodesList';
import PlayDraw from '../PlayDraw';

import styles from './index.module.less';


const defaultTasks = {
  nodes: [
    {
      id: 'start',
      label: '流程开始',
      type: 'ellipse',
      size: [96, 48],
      x: 400,
      y: 100,
      // action: tasks[key].action,
      // publish: tasks[key].publish,
      // description: tasks[key].description,
      // next: next && next.default,
      anchorPoints: [[0.5, 1]],
      linkPoints: {
        top: false,
        bottom: true,
        left: false,
        right: false,
        fill: '#5E728C',
        stroke: '#5E728C',
      },
    },
    {
      id: 'end',
      label: '流程结束',
      type: 'ellipse',
      size: [96, 48],
      x: 400,
      y: 400,
      // action: tasks[key].action,
      // publish: tasks[key].publish,
      // description: tasks[key].description,
      // next: next && next.default,
      anchorPoints: [[0.5, 0]],
      linkPoints: {
        top: true,
        bottom: false,
        left: false,
        right: false,
        fill: '#5E728C',
        stroke: '#5E728C',
      },
    },
  ],
  edges: [
    // {
    //   source: 'start',
    //   target: 'end',
    //   targetAnchor: 0,
    // },
  ],
};

const EditPlayBook = () => {
  const playList = [
    {
      created_at: '2021-09-03 19:00:25',
      definition:
        'version: \'2.0\'\n"\\u6F0F\\u6D1E\\u544A\\u8B66\\u63A8\\u9001_1":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u65E0", type: string}\n    required: []\n  tags: ["\\u6F0F\\u6D1E\\u544A\\u8B66", "\\u4F5C\\u6218\\u6307\\u6325\\u5BA4"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 394 62\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: BugAlarmFromTide  app="17e5bfc5-ca59-47ad-8720-2e36cf59922f" script=""\n        isSwitch=false using="d1346b9c-2120-47f3-bc79-f5e3c5433a42" integration=true\n      loc: 404.5 166\n      nick: "\\u83B7\\u53D6\\u6F0F\\u6D1E\\u544A\\u8B66"\n      on-success:\n        default: [uuid3]\n      publish: {flag: <% task(uuid2).result.content.flag  %>, result: <% task(uuid2).result.content.result  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="0f327504-dfee-4336-9928-72d08b65ce37" integration=true\n      loc: 408.5 279\n      nick: "\\u63A8\\u9001\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag  %>}\n  type: direct\n',
      description: null,
      id: '06c34085-bb17-46de-a3e1-44769bab2065',
      input: 'json',
      is_system: false,
      name: '漏洞告警推送_1',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '无',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['漏洞告警', '作战指挥室'],
      updated_at: '2021-09-03 19:00:25',
    },
    {
      created_at: '2021-09-03 19:00:25',
      definition:
        'version: \'2.0\'\n"whois\\u67E5\\u8BE2_1":\n  description: "whois\\u67E5\\u8BE2"\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u57DF\\u540D", type: string}\n    required: []\n  tags: [whois, "\\u57DF\\u540D", "\\u4F5C\\u6218\\u6307\\u6325\\u5BA4"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 407 257\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 403 -55\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: log_analysis-6d368988-6001-45b6-96f3-48de71de7dd1 text=<% $.json %>\n        app="" script="log_analysis-6d368988-6001-45b6-96f3-48de71de7dd1" isSwitch=false\n        using="" integration=false\n      loc: 406 49.5\n      nick: "\\u65E5\\u5FD7\\u89E3\\u6790"\n      on-success:\n        default: [uuid3]\n      publish: {ip: <% task(uuid2).result.content.ip  %>}\n    uuid3:\n      action: whois-3215349f-f2dd-49af-b9c6-3f1744707909 text=<% $.ip %> app="" script="whois-3215349f-f2dd-49af-b9c6-3f1744707909"\n        isSwitch=false using="" integration=false\n      loc: 399 161.5\n      nick: whois\n      on-success:\n        default: [end]\n      publish: {text: <% task(uuid3).result.content.text  %>}\n  type: direct\n',
      description: 'whois查询',
      id: '21194c59-cdd9-4654-b102-0b4699816216',
      input: 'json',
      is_system: false,
      name: 'whois查询_1',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '域名',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['whois', '域名', '作战指挥室'],
      updated_at: '2021-09-03 19:00:25',
    },
    {
      created_at: '2021-05-08 20:23:35',
      definition:
        'version: \'2.0\'\n"whois\\u67E5\\u8BE2":\n  description: "whois\\u67E5\\u8BE2"\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u57DF\\u540D", type: string}\n    required: []\n  tags: [whois, "\\u57DF\\u540D", "\\u4F5C\\u6218\\u6307\\u6325\\u5BA4"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 407 257\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 403 -55\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: log_analysis-6d368988-6001-45b6-96f3-48de71de7dd1 text=<% $.json %>\n        app="" script="log_analysis-6d368988-6001-45b6-96f3-48de71de7dd1" isSwitch=false\n        using="" integration=false\n      loc: 406 49.5\n      nick: "\\u65E5\\u5FD7\\u89E3\\u6790"\n      on-success:\n        default: [uuid3]\n      publish: {ip: <% task(uuid2).result.content.ip  %>}\n    uuid3:\n      action: whois-3215349f-f2dd-49af-b9c6-3f1744707909 text=<% $.ip %> app="" script="whois-3215349f-f2dd-49af-b9c6-3f1744707909"\n        isSwitch=false using="" integration=false\n      loc: 399 161.5\n      nick: whois\n      on-success:\n        default: [end]\n      publish: {text: <% task(uuid3).result.content.text  %>}\n  type: direct\n',
      description: 'whois查询',
      id: 'd1b20f91-073a-4448-a37f-cdacbbf33cff',
      input: 'json',
      is_system: false,
      name: 'whois查询',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '域名',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['whois', '域名', '作战指挥室'],
      updated_at: '2021-09-03 00:43:58',
    },
    {
      created_at: '2021-08-20 10:24:19',
      definition:
        'version: \'2.0\'\n"\\u6F0F\\u6D1E\\u544A\\u8B66\\u63A8\\u9001":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u65E0", type: string}\n    required: []\n  tags: ["\\u6F0F\\u6D1E\\u544A\\u8B66", "\\u4F5C\\u6218\\u6307\\u6325\\u5BA4"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 394 62\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: BugAlarmFromTide  app="17e5bfc5-ca59-47ad-8720-2e36cf59922f" script=""\n        isSwitch=false using="d1346b9c-2120-47f3-bc79-f5e3c5433a42" integration=true\n      loc: 404.5 166\n      nick: "\\u83B7\\u53D6\\u6F0F\\u6D1E\\u544A\\u8B66"\n      on-success:\n        default: [uuid3]\n      publish: {flag: <% task(uuid2).result.content.flag  %>, result: <% task(uuid2).result.content.result  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="0f327504-dfee-4336-9928-72d08b65ce37" integration=true\n      loc: 408.5 279\n      nick: "\\u63A8\\u9001\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag  %>}\n  type: direct\n',
      description: null,
      id: 'd7253fa8-c17f-42f4-90fd-ac0454ea33eb',
      input: 'json',
      is_system: false,
      name: '漏洞告警推送',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '无',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['漏洞告警', '作战指挥室'],
      updated_at: '2021-09-03 00:43:02',
    },
    {
      created_at: '2021-08-04 12:12:02',
      definition:
        'version: \'2.0\'\n"\\u8681\\u5251_php_chr\\u89E3\\u5BC6":\n  description: null\n  input: [encode_body]\n  runner: workflow\n  schemas:\n    properties:\n      encode_body: {name: "\\u5F00\\u59CB", type: string}\n    required: []\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: antsword_php_chr-897549c0-aeb6-4452-9571-4dd83bc73171 encode_body=<%\n        $.encode_body %> app="" script="antsword_php_chr-897549c0-aeb6-4452-9571-4dd83bc73171"\n        isSwitch=false using="" integration=false\n      loc: 373.703125 186.5\n      nick: "\\u89E3\\u5BC6"\n      on-success:\n        default: [uuid3]\n      publish: {text: <% task(uuid2).result.content.text %>}\n    uuid3:\n      action: send_msg msg=<% $.text %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="0f327504-dfee-4336-9928-72d08b65ce37" integration=true\n      loc: 386.703125 297.5\n      nick: "\\u63A8\\u9001\\u5230\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'c369c74c-369d-415a-a003-628d0951464c',
      input: 'encode_body',
      is_system: false,
      name: '蚁剑_php_chr解密',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          encode_body: {
            name: '开始',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: [],
      updated_at: '2021-08-04 12:12:02',
    },
    {
      created_at: '2021-06-23 15:12:38',
      definition:
        'version: \'2.0\'\n"\\u5FAE\\u4FE1APP":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u6D4B\\u8BD5", type: string}\n    required: []\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 402 367\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: send_msg msg=<% $.json %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="0f327504-dfee-4336-9928-72d08b65ce37" integration=true\n      loc: 395.5 226\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid2).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'd913ebbe-05c0-4200-a26c-e6cd3a20ba68',
      input: 'json',
      is_system: false,
      name: '微信APP',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '测试',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: [],
      updated_at: '2021-08-04 11:32:11',
    },
    {
      created_at: '2021-07-07 16:31:55',
      definition:
        'version: \'2.0\'\n"\\u6D4B\\u8BD5Quake\\u67E5\\u8BE2":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u8F93\\u5165", type: string}\n    required: [json]\n  tags: ["\\u4FE1\\u606F\\u641C\\u96C6"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 392 80\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: SingleUseCall ipordomain=<% $.json %> app="29c20046-8c8b-4fc0-a4db-6800cc5cdb5c"\n        script="" isSwitch=false using="c03de29e-3977-485d-87dd-2ab9c6cf6700" integration=true\n      loc: 396.5 180\n      nick: "Quake\\u67E5\\u8BE2"\n      on-success:\n        default: [uuid3]\n      publish: {flag: <% task(uuid2).result.content.flag %>, ipordomain: <% task(uuid2).result.content.ipordomain\n          %>, result: <% task(uuid2).result.content.result %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 393.5 287\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag  %>}\n  type: direct\n',
      description: null,
      id: 'a1c2e704-9aaf-4d55-b0a6-5bdc95aa06f1',
      input: 'json',
      is_system: false,
      name: '测试Quake查询',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '输入',
            type: 'string',
          },
        },
        required: ['json'],
      },
      scope: 'private',
      tags: ['信息搜集'],
      updated_at: '2021-07-07 16:32:27',
    },
    {
      created_at: '2021-06-28 21:11:30',
      definition:
        '"XXE\\u6CE8\\u5165\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="6adccfb4-a558-477a-935a-6eacf8f61059"\n        script="" isSwitch=false using="" integration=true\n      loc: 383.5 190\n      nick: "XXE\\u6CE8\\u5165\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 377.5 303\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: '39303c72-9562-41df-a2ad-7e6192865de2',
      input: 'json',
      is_system: false,
      name: 'XXE注入告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:11:30',
    },
    {
      created_at: '2021-06-28 21:10:31',
      definition:
        '"WebShell\\u4E0A\\u4F20\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="29dedef7-78ed-49a2-9cd9-ae3c14e66dc5"\n        script="" isSwitch=false using="" integration=true\n      loc: 397.5 184\n      nick: "WebShell\\u4E0A\\u4F20\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 397.5 281\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: '20174607-f6fe-4264-b916-4046a1d4aa43',
      input: 'json',
      is_system: false,
      name: 'WebShell上传告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:10:31',
    },
    {
      created_at: '2021-06-28 21:09:24',
      definition:
        '"WebShell\\u5229\\u7528\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="bba1c878-93f2-4e61-a504-09a57ecdc32d"\n        script="" isSwitch=false using="" integration=true\n      loc: 390.5 190\n      nick: "WebShell\\u5229\\u7528\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 393.5 308\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: 'e434729b-0d14-4cf4-90b3-d708f145958a',
      input: 'json',
      is_system: false,
      name: 'WebShell利用告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:09:24',
    },
    {
      created_at: '2021-06-28 21:05:54',
      definition:
        'version: \'2.0\'\n"\\u7CFB\\u7EDF\\u670D\\u52A1\\u914D\\u7F6E\\u4E0D\\u5F53\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="0406ee94-94de-4bb2-91bf-f3a9b6e82238"\n        script="" isSwitch=false using="" integration=true\n      loc: 389.5 193\n      nick: "\\u7CFB\\u7EDF\\u670D\\u52A1\\u914D\\u7F6E\\u4E0D\\u5F53\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 390.5 299\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '0912520b-5fef-4357-a404-a7258d4938eb',
      input: 'json',
      is_system: false,
      name: '系统服务配置不当告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:05:54',
    },
    {
      created_at: '2021-06-28 21:04:53',
      definition:
        '"SSRF\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="9fd1bbef-8d2f-4bef-afea-d12bc119abab"\n        script="" isSwitch=false using="" integration=true\n      loc: 398.5 195\n      nick: "SSRF\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 381.5 291\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: '95deef04-f903-4d9e-bbf5-d1dc79de7679',
      input: 'json',
      is_system: false,
      name: 'SSRF告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:04:53',
    },
    {
      created_at: '2021-06-28 21:04:01',
      definition:
        '"SQL\\u6CE8\\u5165\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="47d2bdc0-aa84-4bfe-8e93-0621944d8c4d"\n        script="" isSwitch=false using="" integration=true\n      loc: 385.5 198\n      nick: "SQL\\u6CE8\\u5165\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, result: <% task(uuid2).result.content.result\n          %>, support: <% task(uuid2).result.content.support %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 377.5 301\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: 'fa60264b-c306-428d-b390-36139cc72973',
      input: 'json',
      is_system: false,
      name: 'SQL注入告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:04:01',
    },
    {
      created_at: '2021-06-28 21:03:03',
      definition:
        'version: \'2.0\'\n"\\u8FDC\\u7A0B\\u4EE3\\u7801\\u6267\\u884C\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="91df8d41-c456-41cf-873c-b66333ce0c4d"\n        script="" isSwitch=false using="" integration=true\n      loc: 378.5 199\n      nick: "\\u8FDC\\u7A0B\\u4EE3\\u7801\\u6267\\u884C\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 379.5 304\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '9bc87e3f-3c7c-4fd1-b01d-7a7e7c866d69',
      input: 'json',
      is_system: false,
      name: '远程代码执行告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:03:03',
    },
    {
      created_at: '2021-06-28 21:02:02',
      definition:
        'version: \'2.0\'\n"\\u8FDC\\u7A0B\\u547D\\u4EE4\\u6267\\u884C\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="a752c9f9-ab5e-4835-a3ab-6aad09ad9397"\n        script="" isSwitch=false using="" integration=true\n      loc: 403.5 194\n      nick: "\\u8FDC\\u7A0B\\u547D\\u4EE4\\u6267\\u884C\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 406.5 302\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'a17794ee-4914-41ad-940f-b142dcbc45e5',
      input: 'json',
      is_system: false,
      name: '远程命令执行告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:02:02',
    },
    {
      created_at: '2021-06-28 21:00:33',
      definition:
        'version: \'2.0\'\n"\\u4FE1\\u606F\\u6CC4\\u9732\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="6fc57900-da4d-49da-b6bf-650763f23d6f"\n        script="" isSwitch=false using="" integration=true\n      loc: 398.5 188\n      nick: "\\u4FE1\\u606F\\u6CC4\\u9732\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 400.5 309\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '3d96a85d-3688-49ae-86a3-42bfc416d004',
      input: 'json',
      is_system: false,
      name: '信息泄露告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 21:00:33',
    },
    {
      created_at: '2021-06-28 20:59:25',
      definition:
        'version: \'2.0\'\n"\\u6587\\u4EF6\\u4E0A\\u4F20\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E "]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="0d24b58d-1aec-4940-b420-ef1d9e5b6f52"\n        script="" isSwitch=false using="" integration=true\n      loc: 392.5 188\n      nick: "\\u6587\\u4EF6\\u4E0A\\u4F20\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 385.5 278\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'b7aadc03-1fae-4dd2-95bb-6f26dc04a45b',
      input: 'json',
      is_system: false,
      name: '文件上传告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实 '],
      updated_at: '2021-06-28 20:59:25',
    },
    {
      created_at: '2021-06-28 20:58:26',
      definition:
        'version: \'2.0\'\n"\\u6587\\u4EF6\\u5305\\u542B\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="3ad11633-ec7c-4505-8f48-4990872d40bc"\n        script="" isSwitch=false using="" integration=true\n      loc: 400.5 185\n      nick: "\\u6587\\u4EF6\\u5305\\u542B\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 398.5 293\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '82e90d82-1576-480a-9252-bb24aac81acb',
      input: 'json',
      is_system: false,
      name: '文件包含告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:58:26',
    },
    {
      created_at: '2021-06-28 20:57:07',
      definition:
        'version: \'2.0\'\n"\\u6587\\u4EF6\\u4E0B\\u8F7D\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="e15d41a4-7439-4fdd-8449-0aa0c3cb9a85"\n        script="" isSwitch=false using="" integration=true\n      loc: 416.5 179\n      nick: "\\u6587\\u4EF6\\u4E0B\\u8F7D\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 393.5 304\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'bf34203f-fa76-42bb-bd35-efc74b763af6',
      input: 'json',
      is_system: false,
      name: '文件下载告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:57:07',
    },
    {
      created_at: '2021-06-25 10:43:13',
      definition:
        'version: \'2.0\'\n"\\u5F31\\u53E3\\u4EE4\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u6D4B\\u8BD5", type: string}\n    required: [json]\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 378 417\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 377 80\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="a50ed0f9-64af-4ef0-9114-7c4afb558508"\n        script="" isSwitch=false using="" integration=true\n      loc: 366.5 188\n      nick: "\\u5F31\\u53E3\\u4EE4\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code  %>, msg: <% task(uuid2).result.content.msg  %>,\n        result: <% task(uuid2).result.content.result  %>, support: <% task(uuid2).result.content.support  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 369.5 296\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'd5c63365-b1c2-4c9a-8985-bef7d8602623',
      input: 'json',
      is_system: false,
      name: '弱口令告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '测试',
            type: 'string',
          },
        },
        required: ['json'],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:52:33',
    },
    {
      created_at: '2021-06-28 20:52:32',
      definition:
        'version: \'2.0\'\n"\\u76EE\\u5F55\\u904D\\u5386\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 402 41\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="b217480e-dac3-4ba4-afb0-c050bb54db57"\n        script="" isSwitch=false using="" integration=true\n      loc: 362 134.5\n      nick: "\\u76EE\\u5F55\\u904D\\u5386\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code %>, msg: <% task(uuid2).result.content.msg\n          %>, result: <% task(uuid2).result.content.result %>, support: <% task(uuid2).result.content.support\n          %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 403 245.5\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '43ec2fd1-22db-40d7-8483-552e35dacf85',
      input: 'json',
      is_system: false,
      name: '目录遍历告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:52:32',
    },
    {
      created_at: '2021-06-23 15:29:19',
      definition:
        'version: \'2.0\'\n"\\u672A\\u6388\\u6743\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u4EA4\\u4E92\\u62A5\\u6587", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="84c31a42-5880-4be0-882d-893895daf57c"\n        script="" isSwitch=false using="" integration=true\n      loc: 386.5 207\n      nick: "\\u672A\\u6388\\u6743\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code  %>, msg: <% task(uuid2).result.content.msg  %>,\n        result: <% task(uuid2).result.content.result  %>, support: <% task(uuid2).result.content.support  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 392.5 317\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '241b621d-d0c6-4ab1-a06a-18f8d0463c26',
      input: 'json',
      is_system: false,
      name: '未授权告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '交互报文',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:52:19',
    },
    {
      created_at: '2021-06-28 20:48:26',
      definition:
        'version: \'2.0\'\n"\\u6587\\u4EF6\\u8BFB\\u53D6\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 421 65\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="e055d192-2c24-44e5-8a7e-871b2cc96520"\n        script="" isSwitch=false using="" integration=true\n      loc: 420.5 176\n      nick: "\\u6587\\u4EF6\\u8BFB\\u53D6\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code  %>, msg: <% task(uuid2).result.content.msg  %>,\n        result: <% task(uuid2).result.content.result  %>, support: <% task(uuid2).result.content.support  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 399.5 292\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: 'a3d331f7-041c-4cc6-a65b-45a4f4c2e958',
      input: 'json',
      is_system: false,
      name: '文件读取告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:51:57',
    },
    {
      created_at: '2021-06-28 20:51:03',
      definition:
        'version: \'2.0\'\n"\\u53CD\\u5E8F\\u5217\\u5316\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 402 41\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="2620a8cd-adf8-4b0c-89af-27a411770744"\n        script="" isSwitch=false using="" integration=true\n      loc: 384 125.5\n      nick: "\\u53CD\\u5E8F\\u5217\\u5316\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code  %>, msg: <% task(uuid2).result.content.msg  %>,\n        result: <% task(uuid2).result.content.result  %>, support: <% task(uuid2).result.content.support  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 392 247.5\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\n',
      description: null,
      id: '3f31f59b-c93a-4f95-92fa-39b1bf1f1a6f',
      input: 'json',
      is_system: false,
      name: '反序列化告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:51:28',
    },
    {
      created_at: '2021-06-28 20:49:55',
      definition:
        '"CSRF\\u544A\\u8B66\\u6838\\u5B9E":\n  description: null\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66", type: string}\n    required: []\n  tags: ["\\u544A\\u8B66\\u6838\\u5B9E"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 409 376\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 402 41\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: CheckByRuleId entry=<% $.json %> app="2874fcae-8cc6-490e-bbfb-e41f94539e84"\n        script="" isSwitch=false using="" integration=true\n      loc: 418 145.5\n      nick: "CSRF\\u544A\\u8B66\\u6838\\u5B9E"\n      on-success:\n        default: [uuid3]\n      publish: {code: <% task(uuid2).result.content.code  %>, msg: <% task(uuid2).result.content.msg  %>,\n        result: <% task(uuid2).result.content.result  %>, support: <% task(uuid2).result.content.support  %>}\n    uuid3:\n      action: send_msg msg=<% $.result %> app="0f2b375c-44c4-4195-b05f-69a0295de595"\n        script="" isSwitch=false using="2664a7fb-6678-4206-86bd-46973a94e675" integration=true\n      loc: 409 260.5\n      nick: "\\u53D1\\u9001\\u81F3\\u5FAE\\u4FE1"\n      on-success:\n        default: [end]\n      publish: {flag: <% task(uuid3).result.content.flag %>}\n  type: direct\nversion: \'2.0\'\n',
      description: null,
      id: '929a92e5-5891-45d2-ae39-2dc569a2deb7',
      input: 'json',
      is_system: false,
      name: 'CSRF告警核实',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['告警核实'],
      updated_at: '2021-06-28 20:51:01',
    },
    {
      created_at: '2021-05-21 22:52:33',
      definition:
        '"VT\\u67E5\\u8BE2\\u653B\\u51FBIP\\u60C5\\u62A5":\n  description: "\\u6839\\u636E\\u653B\\u51FBIP\\u67E5\\u8BE2VT\\u60C5\\u62A5\\u4FE1\\u606F"\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: IP, type: string}\n    required: []\n  tags: [VT, "\\u60C5\\u62A5", "\\u653B\\u51FBIP\\u67E5\\u8BE2"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: -271 303\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: -232 -90\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: get_sip-98dae945-2588-4677-8148-b0271be9aa33 json=<% $.json %> app=""\n        script="get_sip-98dae945-2588-4677-8148-b0271be9aa33" isSwitch=false using=""\n        integration=false\n      loc: -252 45\n      nick: "\\u83B7\\u53D6\\u653B\\u51FBIP"\n      on-success:\n        default: [uuid3]\n      publish: {ip: <% task(uuid2).result.content.ip  %>}\n    uuid3:\n      action: virustotal_query_ips ip=<% $.ip %> app="40f57088-72ba-45ea-9746-7de915847716"\n        script="" isSwitch=false using="b4ed3e1c-6fd1-43ec-956e-0dc9f45b143a" integration=true\n      loc: -280 188\n      nick: "IP\\u67E5\\u8BE2VT\\u60C5\\u62A5"\n      on-success:\n        default: [end]\n      publish: {results_ip: <% task(uuid3).result.content.results_ip  %>}\n  type: direct\nversion: \'2.0\'\n',
      description: '根据攻击IP查询VT情报信息',
      id: 'f610a24e-23b2-47c1-96a6-af5d6bde8ca8',
      input: 'json',
      is_system: false,
      name: 'VT查询攻击IP情报',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: 'IP',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['VT', '情报', '攻击IP查询'],
      updated_at: '2021-05-24 22:43:10',
    },
    {
      created_at: '2021-04-20 16:02:18',
      definition:
        'version: \'2.0\'\n"\\u8BA1\\u7B97md5":\n  description: "\\u8BA1\\u7B97md5"\n  input: [a]\n  runner: workflow\n  schemas:\n    properties:\n      a: {name: "\\u5B57\\u7B26\\u4E32", type: string}\n    required: []\n  tags: ["\\u5DE5\\u5177", md5]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: 400 400\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: 400 100\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: md5 text=<% $.a %> app="" script="md5" isSwitch=false using="" integration=false\n      loc: 391 250.5\n      nick: jsmd5\n      on-success:\n        default: [end]\n      publish: {result: <% task(uuid2).result.content.result  %>}\n  type: direct\n',
      description: '计算md5',
      id: '9b45b188-b380-4470-999b-92396079372b',
      input: 'a',
      is_system: false,
      name: '计算md5',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          a: {
            name: '字符串',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['工具', 'md5'],
      updated_at: '2021-05-21 23:39:38',
    },
    {
      created_at: '2021-05-18 12:57:01',
      definition:
        'version: \'2.0\'\n"\\u901A\\u8FC7\\u90AE\\u4EF6\\u53D1\\u9001\\u544A\\u8B66\\u4FE1\\u606F":\n  description: "\\u901A\\u8FC7\\u90AE\\u4EF6\\u53D1\\u9001\\u544A\\u8B66\\u4FE1\\u606F"\n  input: [json]\n  runner: workflow\n  schemas:\n    properties:\n      json: {name: "\\u544A\\u8B66\\u5185\\u5BB9", type: string}\n    required: []\n  tags: ["\\u90AE\\u4EF6", "\\u544A\\u8B66\\u5916\\u53D1"]\n  tasks:\n    end:\n      action: end using="" intergration=false\n      loc: -224 446\n      nick: "\\u6D41\\u7A0B\\u7ED3\\u675F"\n      publish: {data: <% task(end).result.content.data %>}\n    start:\n      action: start using="" intergration=false\n      loc: -205 -2\n      nick: "\\u6D41\\u7A0B\\u5F00\\u59CB"\n      on-success:\n        default: [uuid2]\n      publish: {data: <% task(start).result.content.data %>}\n    uuid2:\n      action: alert-dda432a6-654b-4baf-88e7-4bb0013344db json=<% $.json %> app=""\n        script="alert-dda432a6-654b-4baf-88e7-4bb0013344db" isSwitch=false using=""\n        integration=false\n      loc: -207 132\n      nick: "\\u5904\\u7406\\u544A\\u8B66\\u4FE1\\u606F"\n      on-success:\n        default: [uuid3]\n      publish: {content: <% task(uuid2).result.content.content  %>, title: <% task(uuid2).result.content.title  %>}\n    uuid3:\n      action: send_mail title=<% $.title %> content=<% $.content %> app="b9dce992-46a9-45a7-a37f-4c0107e82134"\n        script="" isSwitch=false using="80dc3ba9-60f4-47e8-a825-27d864a80252" integration=true\n      loc: -215 280\n      nick: "\\u544A\\u8B66\\u53D1\\u9001"\n      on-success:\n        default: [end]\n      publish: {result: <% task(uuid3).result.content.result  %>}\n  type: direct\n',
      description: '通过邮件发送告警信息',
      id: '094ca9fd-7bfe-4f75-bfe8-af04ffdb4c2d',
      input: 'json',
      is_system: false,
      name: '通过邮件发送告警信息',
      namespace: 'ns1',
      project_id: null,
      run_last_at: null,
      schemas: {
        properties: {
          json: {
            name: '告警内容',
            type: 'string',
          },
        },
        required: [],
      },
      scope: 'private',
      tags: ['邮件', '告警外发'],
      updated_at: '2021-05-21 23:38:52',
    },
  ].map(item => ({ ...item, definition: YAML.parse(item.definition), key: item.id }));
  const appList = [];
  const scriptList = [
    'hash',
    'http',
    'ip',
    '对象操作',
    '工具',
    '手机号',
    '数据处理',
    '文本格式化',
    '日期格式化',
    '编码',
    '解码',
    '计算器',
    '转码',
    '输入检查',
  ].reduce((pre, cur) => {
    if (!cur.length) return pre;
    return pre.concat(cur);
  }, []);
  const id = '06c34085-bb17-46de-a3e1-44769bab2065';
  const editType = undefined;
  return (
    <Container flex className={styles.root}>
      <NodesList />
      <PlayDraw
        type={id ? 'editPlay' : 'addPlay'}
        isCopy={editType === 'copy'}
        playInfo={id && playList.find((item) => item.id === id)}
        appList={appList}
        scriptList={scriptList}
        defaultTasks={defaultTasks}
      />
    </Container>
  );
};

export default EditPlayBook;
